<?php
// +----------------------------------------------------------------------
// | 会员管理首页
// +----------------------------------------------------------------------
// | Copyright (c) 2015
// +----------------------------------------------------------------------
// | Author: baiping 125618036@qq.com http://www.webipcode.com
// +----------------------------------------------------------------------
// | 2015-6-26上午11:13:48
// +----------------------------------------------------------------------
?>
<?php $this->load->view('public/header');?>
<?php $this->load->view('public/head');?>
<div class="container-fluid">
	<div class="row">
		<?php $this->load->view('public/sideleft');?>
		<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main ">
			<!-- 内容区 -->
			<div class="main-title">
				<h3>
					<?php echo $meta_title ?>
				</h3>
			</div>
			<div class="con">
				<div class="cf">
					<div class="pull-left">
					<a href="<?php echo site_url('menu/changesstatus/delete')?>" class="btn btn-danger ajax-post confirm" target-form="ids">删除</a>
					<?php if ( 0 == intval( $this->uri->segment(3) )  ){ ?>
						<a href="<?php echo site_url('menu/create')?>" class="btn btn-primary">新增</a>
					<?php }else{?>	 
						<a href="<?php echo site_url('menu/create/'.$this->uri->segment(3) )?>" class="btn btn-primary">新增</a>
						<a href="javascript:void(0);" class="btn btn-info gohistory">返回</a>
					<?php }?>	 
						
						
					</div>
					<div class="pull-right search-form">
						<form action="<?php echo site_url('menu/index')?>" method="post" name="search_form">
							<input class="search-input" type="text" placeholder="请输入菜单名称" name="search_name">
							<button type="submit" name="sub" class="btn btn-primary">
								<i class="glyphicon glyphicon-search"></i>
							</button>
						</form>
					</div>
				</div>
				<div class="clearfix"></div>
				<!-- 内容列表 -->
				<?php if ( $record_count > 0 ){?>
				<form action="<?php echo site_url('menu/sort'); ?>" method="post" name="form">
				<table class="table table-striped table-hover ">
					<thead>
						<tr>
							<th class="row-selected"><input class="checkbox check-all" type="checkbox"></th>
							<th>ID</th>
							<th>排序</th>
							<th>名称</th>
							<th>上级菜单</th>
							<th>分组</th>
							<th>URL</th>
							<th>仅开发模式可见</th>
							<th>隐藏</th>
							<th>操作</th>
						</tr>
					</thead>
					<?php foreach($list as $key => $val){?>
					<tr>
						<td>
						<?php if ( 1 == $val->id ){?>
							<input class="ids row-selected" type="checkbox" value="<?php echo $val->id; ?>" name="id[]" disabled="disabled">
						<?php }else{?>
							<input class="ids row-selected" type="checkbox" value="<?php echo $val->id; ?>" name="id[]">
						<?php }?>	
						</td>
						<td><?php echo $val->id;?></td>
						<td><input type="text" value="<?php echo $val->sort;?>" name="sort[<?php echo $val->id; ?>]" size="3" /></td>
						<td><small><a href="<?php echo site_url('menu/index/'.$val->id)?>"><?php echo $val->title;?></a></small></td>
						<td><small>
							<?php if ( 0 == $val->pid){?>无
							<?php }else{?>
							<?php echo $val->up_title; }?>
							</small>
						</td>
						<td><?php echo $val->group;?></td>
						<td><?php echo $val->url;?></td>
						<td>
						<?php if($val->is_dev){?>
						<span class="label label-success">是</span>
						<?php }else{?>
						<span class="label label-info">否</span>
						<?php }?>
						</td>
						<td>
							<?php if($val->hide == 1){?>
							<span class="label label-success">是</span>
							<?php }elseif($val->hide == 0){?>
							<span class="label label-info">否</span>
							<?php }?></td>
						<td>
							<a href="<?php echo site_url('menu/modfiy/'.$val->id)?>">编辑</a>
							<a href="<?php echo site_url('menu/del?id='.$val->id)?>" class="confirm ajax-get">删除</a>
						</td>
					</tr>
					<?php }?>
					<tr>
						<td colspan="10">
							<BUTTON type="submit" class="btn btn-primary">排序</BUTTON>
							<small class="helpblock">PS:排序数值越大排序越靠前</small>
						</td>
					</tr>
				</table>
				</form>
				<?php }else{?>
				<div class="alert alert-warning" role="alert">哦亲！暂无数据</div>
				<?php }?>	
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
//左侧菜单高亮显示
highlight_subnav( '<?php echo site_url('menu/index')?>' );
</script>
<?php $this->load->view('public/footer');?>